home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / INTERVIE / RUBVERTS.H < prev    next >
C/C++ Source or Header  |  1980-01-03  |  3KB  |  96 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /*
  24.  * GrowingVertices and subclasses - rubberbands defined by a set of vertices 
  25.  * that can grow dynamically in number.
  26.  */
  27.  
  28. #ifndef rubverts_h
  29. #define rubverts_h
  30.  
  31. #include <InterViews/rubband.h>
  32.  
  33. class GrowingVertices : public Rubberband {
  34. public:
  35.     GrowingVertices(
  36.         Painter*, Canvas*, Coord px[], Coord py[], int n,
  37.         Coord offx = 0, Coord offy = 0
  38.     );
  39.     virtual ~GrowingVertices();
  40.  
  41.     virtual void AppendVertex(Coord, Coord);
  42.     virtual void Draw();
  43.  
  44.     virtual void GetOriginal(Coord*& px, Coord*& py, int& n);
  45.     virtual void GetCurrent(Coord*& px, Coord*& py, int& n);
  46. protected:
  47.     void CheckBufs();
  48.     void Copy(Coord*, Coord*, int, Coord*&, Coord*&);
  49.     virtual void DrawVertices(Coord*, Coord*, int);
  50. protected:
  51.     Coord* x, *y;
  52.     int count, bufsize, origbufsize;
  53. };
  54.  
  55. class GrowingMultiLine : public GrowingVertices {
  56. public:
  57.     GrowingMultiLine(
  58.         Painter*, Canvas*, Coord px[], Coord py[], int n,
  59.         Coord offx = 0, Coord offy = 0
  60.     );
  61. protected:
  62.     virtual void DrawVertices(Coord*, Coord*, int);
  63. };
  64.  
  65. class GrowingPolygon : public GrowingVertices {
  66. public:
  67.     GrowingPolygon(
  68.         Painter*, Canvas*, Coord px[], Coord py[], int n,
  69.         Coord offx = 0, Coord offy = 0
  70.     );
  71. protected:
  72.     virtual void DrawVertices(Coord*, Coord*, int);
  73. };
  74.  
  75. class GrowingBSpline : public GrowingVertices {
  76. public:
  77.     GrowingBSpline(
  78.         Painter*, Canvas*, Coord px[], Coord py[], int n,
  79.         Coord offx = 0, Coord offy = 0
  80.     );
  81. protected:
  82.     virtual void DrawVertices(Coord*, Coord*, int);
  83. };
  84.  
  85. class GrowingClosedBSpline : public GrowingVertices {
  86. public:
  87.     GrowingClosedBSpline(
  88.         Painter*, Canvas*, Coord px[], Coord py[], int n,
  89.         Coord offx = 0, Coord offy = 0
  90.     );
  91. protected:
  92.     virtual void DrawVertices(Coord*, Coord*, int);
  93. };
  94.  
  95. #endif
  96.